package com.gsafety.wellsfort.controller.security;

import com.gsafety.wellsfort.common.util.ApiResponse;
import com.gsafety.wellsfort.domain.vo.MenuVO;
import com.gsafety.wellsfort.service.security.IMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(description = "后台菜单接口")
@RestController
@Slf4j
@RequestMapping("/api/menu")
public class MenuController {

    @Autowired
    private IMenuService menuService;

    /**
     * 菜单列表
     *
     * @return
     */
    @ApiOperation(value = "菜单列表")
    @PostMapping("/list")
    public ApiResponse<List<MenuVO>> list() {
        return ApiResponse.success(menuService.queryRoleMenuList());
    }
}
